
uniform vec2		xyScale;

uniform sampler2D		bloomRender;

varying vec4		texCoord1;
varying vec4		texCoord2;
varying vec4		texCoord3;
varying vec4		texCoord4;
varying vec4		texCoord5;
varying vec4		texCoord6;
varying vec4		texCoord7;
varying vec4		texCoord8;


void main (void){

	vec3		color;

	// Compute the final color using a Gaussian blur filter
	color = texture2D(bloomRender, gl_FragCoord.xy * xyScale).rgb * 0.132981;

	color += texture2D(bloomRender, texCoord1.st).rgb * 0.125794;
	color += texture2D(bloomRender, texCoord1.pq).rgb * 0.125794;

	color += texture2D(bloomRender, texCoord2.st).rgb * 0.106483;
	color += texture2D(bloomRender, texCoord2.pq).rgb * 0.106483;

	color += texture2D(bloomRender, texCoord3.st).rgb * 0.080657;
	color += texture2D(bloomRender, texCoord3.pq).rgb * 0.080657;

	color += texture2D(bloomRender, texCoord4.st).rgb * 0.054670;
	color += texture2D(bloomRender, texCoord4.pq).rgb * 0.054670;

	color += texture2D(bloomRender, texCoord5.st).rgb * 0.033159;
	color += texture2D(bloomRender, texCoord5.pq).rgb * 0.033159;

	color += texture2D(bloomRender, texCoord6.st).rgb * 0.017997;
	color += texture2D(bloomRender, texCoord6.pq).rgb * 0.017997;

	color += texture2D(bloomRender, texCoord7.st).rgb * 0.008741;
	color += texture2D(bloomRender, texCoord7.pq).rgb * 0.008741;

	color += texture2D(bloomRender, texCoord8.st).rgb * 0.003799;
	color += texture2D(bloomRender, texCoord8.pq).rgb * 0.003799;

	gl_FragColor = vec4(color, 1.0);
}
